layui.use(['element','form','util','jquery'], function(){
    var element = layui.element,
        form = layui.form,
        $ = layui.$,
        util = layui.util; //导航的hover效果、二级菜单等功能，需要依赖element模块
    //监听导航点击
    element.on('nav(demo)', function(elem){
        //console.log(elem)
        layer.msg(elem.text());
        console.log(111)
    });

    //监听提交
    form.on('submit(formDemo)', function(data){
        layer.msg(JSON.stringify(data.field));
        return false;
    });

    util.fixbar({
        top: true
    });

    //固定窗口动画控制
    $('.qq').hover(function () {
        $(this).css('background','orange')
        $('.right_fixed_wx').css('display','none')
        $('.right_fixed_qq').css('display','block')
        $('.wx').css('background','#ece8e5')
    })
    $('.wx').hover(function () {
        $(this).css('background','orange')
        $('.right_fixed_qq').css('display','none')
        $('.right_fixed_wx').css('display','block')
        $('.qq').css('background','#ece8e5')
    })
    $('.right_fixed_qq').hover(function () {
        $('.qq').css('background','orange')
    })
    $('.right_fixed_wx').hover(function () {
        $('.wx').css('background','orange')
    })
    $('.fixed_right').hover(function () {
        $('.wx').css('background','#ece8e5')
        $('.qq').css('background','#ece8e5')
    })
    //结束

});